﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataLib.Accounts.Bus;
using System.Data;

namespace Ewts.Storage
{
    public partial class PDNoList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                  if (Session["UserInfo"] != null)
                {
                      User curUser = new DataLib.Accounts.Bus.User();
                    curUser = (User)Session["UserInfo"];
                    if (curUser.UserType != "AD")
                    {
                        bindData(curUser.CompanyCity);
                    }
                
                }
                  else
                  {
                      Response.Redirect("/accounts/login.aspx");
                  }

            }
        }

        public void bindData(string city)
        {
            DataTable dt = new DataTable();
            dt = new DataLib.BLL.InStorage().GetList(" Left(wrlno,1)='R' and cjoid>0 and Left(OutDepart,Len('" + city + "'))='" + city + "'").Tables[0];
            rept.DataSource = dt;
            rept.DataBind();
        }
    }
}